package Utils;

import lombok.Data;

import java.io.Serializable;

/**
 * @Description:
 * @Author: liujh
 * @Date:
 * @UpdateUser: liujh
 * @Date: 2020/07/03$ 11:34$
 * @UpdateRemark:
 * @Version: 1.0
 */
@Data
public class  ResponseData<T> implements Serializable{


    private int code;

    private String msg;

    private  Object data;


    private static ResponseData rs = new ResponseData();

    public static ResponseData success(int code,String msg){
        rs.setCode(code);
        rs.setMsg(msg);
        return rs;
    }


    public static ResponseData success(int code,String msg,Object data){
       rs.setCode(code);
       rs.setMsg(msg);
       rs.setData(data);
       return rs;
    }


    public static ResponseData fail(int code,String msg){
        rs.setCode(code);
        rs.setMsg(msg);
        return rs;
    }

    public static ResponseData error(String errorMsg){
        rs.setMsg(errorMsg);
        return rs;
    }


}
